package cn.net.comsys.vpn.web;

import java.util.List;

import cn.net.comsys.vpn.web.util.DataBase;

/**
 * @author JiF
 * @version 创建时间：2011-4-21 下午02:43:54
 * E-Mail:liaojifeng@163.com
 * 类说明：
 *
 *
 *
 */
public class VpnLoginService {
		public void certAuther(String username,String password) throws Exception{
			if (username==null || password==null || password.length()<3 || username.length()<3){
				
				throw new Exception("非法用户名/密码");
			}
			DataBase db=new DataBase();
			List list = db.getselectRSString("select * from CAS_USER where ULOGINID='"+username+"' and UPASS='"+password+"'");
			if (list==null || list.size()!=1){
				throw new Exception("帐号/密码有误");
			}
		}
		public static void main(String[] args) {
			VpnLoginService vls=new VpnLoginService();
			try {
				vls.certAuther("200910702009", "152611");
				System.out.println("success");
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
}
